package com.itheima.springbootcondition1.config;

import com.itheima.springbootcondition1.condition.ClassCondition;
import com.itheima.springbootcondition1.pojo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConfig {
    @Bean
    @Conditional(ClassCondition.class)//自定义bean 根据条件创建
    public User user() {
        return new User();
    }
}
